<?php

/*
 * core/locale.php
 *
 * handle and provide locale variable
 */

class Locale
{
	public static function init()
	{
		if( $_REQUEST['locale'] )
		{
			$_SESSION['core']['locale'] = $_REQUEST['locale'];
			return;
		}

		if( is_null($_SESSION['core']['locale']) )
		{
			$_SESSION['core']['locale'] = Conf::$c['locale']['default'];
			return;
		}
	}

	public static function get()
	{
		return $_SESSION['core']['locale'];
	}
};

Locale::init();

?>
